<template>
<view class='uni-icon' :style='style' />
</template>

<script setup lang="ts">
  import { IconProps } from '../props'
  import { useIconfont } from '../useIconfont'
  import { computed } from 'vue'
  const props = defineProps(IconProps)
  const {
  colors,
  svgSize,
  quot,
  isStr,
  } = useIconfont(props)
  const style = computed(() => {
      return `background-image: url(${quot.value}data:image/svg+xml, %3Csvg viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg' width='${svgSize.value}px' height='${svgSize.value}px'%3E%3Cpath d='M512 0C228.693333 0 0 228.693333 0 512s228.693333 512 512 512 512-228.693333 512-512S795.306667 0 512 0z m300.373333 556.373333h-327.68v-3.413333H477.866667V153.6c0-17.066667 13.653333-30.72 30.72-30.72s30.72 13.653333 30.72 30.72v341.333333h269.653333c17.066667 0 30.72 13.653333 30.72 30.72 6.826667 17.066667-10.24 30.72-27.306667 30.72z' fill='${(isStr.value ? colors.value : colors.value[0]) || 'rgb(92,214,128)'}' /%3E%3C/svg%3E${quot.value}); width: ${svgSize.value}px; height: ${svgSize.value}px;`
  })
</script>
